export function showToast (title, callBack = () => {}, duration = 1500) {
  uni.showToast({
    icon: 'none',
    title: title,
    duration: duration,
    success: (res) => {
      let timer = setTimeout(() => {
        callBack()
        timer && clearTimeout(timer)
        timer = null
      }, duration)
    }
  })
}

export function showCommonToast (title, duration = 1500) {
  return new Promise((resolve, reject) => {
    uni.showToast({
      icon: 'none',
      title: title,
      duration: duration,
      success: (res) => {
        resolve()
      },
      fail: (err) => {
        reject(err)
      }
    })
  })
}
